import tornado.ioloop
import tornado.web
from controller import *
from tornado.options import define, options

settings = {
    "debug": True,
}

class MainHandler(tornado.web.RequestHandler):
    def get(self):
        self.write("Hello, world")


def make_app():
    return tornado.web.Application([
        (r"/", MainHandler),
        (r"/user", user.UserHandler),
        (r"/forgetPassword", user.ForgetHandler),
        (r"/session", user.SessionHandler),
        (r"/smscode", sms.SmsHandler),
        (r"/patient/([0-9]+)", patient.PatientHandler),
        (r"/patient", patient.PatientHandler),
        (r"/message", system.MessageHandler),
        (r"/feedback", system.FeedbackHandler),
        (r"/photo", photos.PhotoHandler),
        (r"/photo/([0-9]+)", photos.PhotoHandler),
        (r"/appversion/([0-9]+)", system.VerisonHandler),
    ],**settings)

if __name__ == "__main__":
    app = make_app()
    tornado.options.parse_command_line()
    app.listen(8877)
    tornado.ioloop.IOLoop.current().start()

